<?php

namespace SL\FrontBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ImagePresse
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="SL\FrontBundle\Entity\ImagePresseRepository")
 */
class ImagePresse
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;


	/**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    public $path;
	
	  /**
     * @var string
     *
     * @ORM\Column(name="alt", type="string", length=255)
     */
    private $alt;
	
    /**
     * @var boolean
     *
     * @ORM\Column(name="isThumbnail", type="boolean")
     */
    private $isThumbnail;
	
    /**
     * @var integer
     *
     * @ORM\Column(name="position", type="integer")
     */
	private $position;
	
	/**
     * @ORM\ManyToOne(targetEntity="SL\FrontBundle\Entity\Presse", inversedBy="image")
	 * @ORM\JoinColumn(nullable=false)
     */
	private $presse;
	
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

	 /**
     * Set path
     *
     * @param integer $position
     * @return Image
     */
    public function setPosition($position)
    {
        $this->position = $position;
    
        return $this;
    }

    /**
     * Get position
     *
     * @return integer 
     */
    public function getPosition()
    {
        return $this->position;
    }
	
    /**
     * Set path
     *
     * @param string $path
     * @return Image
     */
    public function setPath($path)
    {
        $this->path = $path;
    
        return $this;
    }

    /**
     * Get path
     *
     * @return string 
     */
    public function getPath()
    {
        return $this->path;
    }

    public function getAbsolutePath()
    {
        return null === $this->path ? null : $this->getUploadRootDir().'/'.$this->path;
    }

    public function getWebPath()
    {
        return null === $this->path ? null : $this->getUploadDir().'/'.$this->path;
    }

    protected function getUploadRootDir()
    {
        return __DIR__.'/../../../../web/'.$this->getUploadDir();
    }

    protected function getUploadDir()
    {
        return 'uploads/documents';
    }

    /**
     * Set projet
     *
     * @param \SL\FrontBundle\Entity\Projet $projet
     * @return Image
     */
    public function setProjet(\SL\FrontBundle\Entity\Projet $projet)
    {
        $this->projet = $projet;
    
        return $this;
    }

    /**
     * Get projet
     *
     * @return \SL\FrontBundle\Entity\Projet 
     */
    public function getProjet()
    {
        return $this->projet;
    }

    /**
     * Set isThumbnail
     *
     * @param boolean $isThumbnail
     * @return Image
     */
    public function setIsThumbnail($isThumbnail)
    {
        $this->isThumbnail = $isThumbnail;
    
        return $this;
    }

    /**
     * Get isThumbnail
     *
     * @return boolean 
     */
    public function getIsThumbnail()
    {
        return $this->isThumbnail;
    }

    /**
     * Set alt
     *
     * @param string $alt
     * @return Image
     */
    public function setAlt($alt)
    {
        $this->alt = $alt;
    
        return $this;
    }

    /**
     * Get alt
     *
     * @return string 
     */
    public function getAlt()
    {
        return $this->alt;
    }
}